<template>
  <select @change="selectChange($event.target.value)">
        <option v-for="(title, index) of data" :key="index" :value="index">
          {{ title }}
        </option>
      </select>
</template>

<script setup lang="ts">
import { ref } from 'vue';
const props = defineProps({
    data: {
        type: Array,
        default: () => []
    }
})

const emit = defineEmits(['selectChange'])
const selectChange = (value) => {
    emit('selectChange',value)
}
</script>

<style lang="scss" scoped>

</style>